package cn.hg.jfsa.manage.interceptor;

import javax.servlet.http.HttpServletResponse;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

public class HttpInterceptor implements Interceptor {

	@Override
	public void intercept (Invocation inv) {
		HttpServletResponse response = inv.getController().getResponse();
		response.addHeader("Access-Control-Allow-Origin", "*");// 指定域名
		response.setHeader("Access-Control-Allow-Credentials", "true");
		response.setHeader("Access-Control-Allow-Methods", "*");
		response.setHeader("Access-Control-Allow-Headers", "Content-Type,Access-Token");
		response.setHeader("Access-Control-Expose-Headers", "*");
		inv.invoke();
	}

}
